package com.example.stack;

import com.example.entity.LinkedListStack;
import com.example.entity.LinkedListStack;
import com.example.entity.LinkedNode;

import java.util.*;
import java.util.concurrent.Executor;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadPoolExecutor;

/**
 * @Author: wanqian
 * @Date: 2021/1/26 23:59
 */
public class LinkedListStackDemo {

    public static void main(String[] args) {
        LinkedNode jack = new LinkedNode(1, "Jack");
        LinkedNode tom = new LinkedNode(2, "Tom");
        LinkedNode kris = new LinkedNode(3, "Kris");
        LinkedNode matthew = new LinkedNode(4, "Matthew");

        LinkedListStack linkedList = new LinkedListStack(4);
        linkedList.push(kris);
        linkedList.push(matthew);
        linkedList.push(jack);
        linkedList.push(tom);
        linkedList.list();
        System.out.println(linkedList.isFull());
        System.out.println("栈元素个数："+linkedList.length());
        System.out.println(linkedList.pop());
        System.out.println(linkedList.pop());
        System.out.println(linkedList.pop());
        System.out.println(linkedList.pop());
        System.out.println(linkedList.isEmpty());
        linkedList.list();
        new HashMap<String, Integer>(3) {
            {
                put("a", 1);
                put("b", 2);
                put("c", 3);
            }
        };
        ArrayList<String> strings = new ArrayList<String>(3) {
            {
                add("sdf");
            }
        };
    }
}
